# Create your models here.
from django.db import models
from django.forms import ModelForm #to user see it

class Hotel(models.Model):
    name = models.CharField(max_length=100)

    #photo_single = models.ImageField(upload_to="static/images/", null=True, blank=True)
    #photo_double = models.ImageField(upload_to="static/images/", null=True, blank=True)
    #photo_trible= models.ImageField(upload_to="static/images/", null=True, blank=True)
    #desc_S = models.CharField(max_length=400)
    #desc_D = models.CharField(max_length=400)
    #desc_T = models.CharField(max_length=400)
   
 # On Python 3: def __str__(self):
    
   
    def __unicode__(self):
       return self.name



class HotelForm(ModelForm):
    class Meta:
        model = Hotel
###########################################
class Room(models.Model):
    hotel_id = models.ForeignKey(Hotel)
    ROOM_CHOICES=(('single','s'),('double','d'),('triple','t'),)
    room_type = models.CharField(max_length=50,choices=ROOM_CHOICES,default='single')
    photo = models.ImageField(upload_to="static/images/", null=True, blank=True)
    price = models.PositiveIntegerField(max_length=100)

    #start_date =models.DateTimeField(blank=False)
    #end_date = models.DateTimeField(blank=False)
    #room_type = models.CharField(max_length=100)
    #ROOM_STATUS=(('A','avilable'),('B','busy'),)

    #status=models.CharField(max_length=50,choices=ROOM_STATUS,default='A')
    def __unicode__(self):
       return self.room_type
class RoomForm(ModelForm):
    class Meta:
        model = Room

class Booking(models.Model):
    hotel_id = models.ForeignKey(Hotel)
    room_id = models.ForeignKey(Room)
    start_date =models.DateTimeField()
    end_date = models.DateTimeField()
    comment=models.CharField(max_length=500)
    def __unicode__(self):
       return self.comment
class BookingForm(ModelForm):
    class Meta:
        model = Booking

